<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改文章')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cmsArticle-edit" th:object="${cmsArticle}">
            <input id="articleId" name="articleId" th:field="*{articleId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">文章标题：</label>
				<div class="col-sm-8">
					<input id="title" name="title" th:field="*{title}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">文章内容：</label>
				<div class="col-sm-8">
					<!--<input id="content" name="content" th:field="*{content}" class="form-control" type="text">-->
					<textarea hidden id="content" name="content" style=""></textarea>

					<div id="editor">
						<p th:utext="*{content}"></p>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建者：</label>
				<div class="col-sm-8">
					<input id="createBy" name="createBy" th:field="*{createBy}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建时间：</label>
				<div class="col-sm-8">
					<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">更新者：</label>
				<div class="col-sm-8">
					<input id="updateBy" name="updateBy" th:field="*{updateBy}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">更新时间：</label>
				<div class="col-sm-8">
					<input id="updateTime" name="updateTime" th:field="*{updateTime}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
	<script type="text/javascript" src="https://unpkg.com/wangeditor/release/wangEditor.min.js"></script>
    <script type="text/javascript">
		var prefix = ctx + "system/cmsArticle";
		$("#form-cmsArticle-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-cmsArticle-edit').serialize());
	        }
	    }

		$(document).ready(function () {
			var E = window.wangEditor
			var editor = new E('#editor')
			var $content = $('#content')
			editor.customConfig.onchange = function (html) {
				// 监控变化，同步更新到 textarea
				$content.val(html)
			}
			editor.create()
			$content.val(editor.txt.html())
		})
	</script>
</body>
</html>
